---
layout: m1x_rest
title: Common HTTP Status Codes
---



<ul class="introduction-menu">
    <li><a href='#CommonHTTPStatusCodes-HTTPStatusCodes'>HTTP Status Codes</a></li>
    <li><a href='#CommonHTTPStatusCodes-ErrorMessages'>Error Messages</a></li>
</ul>


<p>HTTP status codes are an essential part of the REST concept. You can get familiar with all of them on <a href="http://en.wikipedia.org/wiki/List_of_http_status_codes">Wikipedia</a>.</p>

<p>The Magento API attempts to return appropriate HTTP status codes for all requests. Any information is returned in the form of a standard HTTP response with an HTTP status code describing the error and the body message.</p>

<h2><a name="CommonHTTPStatusCodes-HTTPStatusCodes"></a>HTTP Status Codes</h2>

<p>The following table contains possible common HTTP status codes:</p>

<table><tbody>
<tr>
<th> Status Code </th>
<th> Message </th>
</tr>
<tr>
<td> 200 OK </td>
<td> &#45; </td>
</tr>
<tr>
<td> 201 Created </td>
<td> Resource was partially created <br class="atl-forced-newline" />
<br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> 207 Multi-Status </td>
<td> &#45; </td>
</tr>
<tr>
<td> 400 Bad Request </td>
<td> Resource data pre-validation error. <br class="atl-forced-newline" />
Resource data invalid. <br class="atl-forced-newline" />
Resource unknown error. <br class="atl-forced-newline" />
The request data is invalid. <br class="atl-forced-newline" />
Resource collection paging error. <br class="atl-forced-newline" />
The paging limit exceeds the allowed number. <br class="atl-forced-newline" />
Resource collection ordering error. <br class="atl-forced-newline" />
Resource collection filtering error. <br class="atl-forced-newline" />
Resource collection including additional attributes error. <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> 403 Forbidden </td>
<td> Access denied. </td>
</tr>
<tr>
<td> 404 Not Found </td>
<td> Resource not found. <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> 405 Method Not Allowed </td>
<td> Resource does not support method. <br class="atl-forced-newline" />
Resource method not implemented yet. <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> 500 Internal Error </td>
<td> Unhandled simple errors. <br class="atl-forced-newline" />
Resource internal error. </td>
</tr>
</tbody></table>


<h2><a name="CommonHTTPStatusCodes-ErrorMessages"></a>Error Messages</h2>

<p>When the Magento API returns an error message, it returns it in your requested format. 例如， an error in the XML format might look like the following:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: xml; gutter: false">&lt;?xml version="1.0"?&gt;
&lt;magento_api&gt;
  &lt;messages&gt;
    &lt;error&gt;
      &lt;data_item&gt;
        &lt;code&gt;404&lt;/code&gt;
        &lt;message&gt;Resource not found.&lt;/message&gt;
      &lt;/data_item&gt;
    &lt;/error&gt;
  &lt;/messages&gt;
&lt;/magento_api&gt;</pre>
		</div>
</div></div>

<p>An error in the JSON format might look like the following:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: java; gutter: false">{"messages":{"error":[{"code":404,"message":"Resource not found."}]}}</pre>
		</div>
</div></div>


<?php include(__ROOT__ . 'footer.php'); ?>		    
